<?php
namespace Home\Model;
use Think\Model;

class MenuModel extends Model{
	 public function sort($cate,$pid=0,$level=0,$html='--'){
	     $tree=array();
	     foreach($cate as $v){
	     	if($v['pid'] == $pid){
	     		$v['level'] = $level + 1;
	     		$v['html'] = str_repeat($html, $level);
	     		$tree[] = $v;
	     		$tree = array_merge($tree, self::sort($cate,$v['uid'],$level+1,$html));
                
	     	}
	     }
	     return $tree;
	 }
}